package com.example.teacherservice.dto;

import lombok.Data;

import java.sql.Timestamp;
import java.time.LocalDateTime;

@Data
public class StudentDTO {
    private Long id;
    private String stuName;
    private Long stuStudyTime;
    private Long stuScore;
    private UserDTO user;
    private Long userId; // 使用数据库实际存在的user_id字段
    private LocalDateTime createTime; // 与实体类保持一致
    private boolean selected;

    public StudentDTO(Long id,String stuName,boolean selected) {
        this.id = id;
        this.stuName = stuName;
        this.selected = selected;
    }

    public StudentDTO() {}

    public StudentDTO(Long id, String name, String s) {
        this.id = id;
        this.stuName = name;
    }

    // 精确匹配查询的构造方法
    public StudentDTO(Long id, String stuName, Long userId, LocalDateTime createTime) {
        this.id = id;
        this.stuName = stuName;
        this.userId = userId;
        this.createTime = createTime;
    }

    public void setClassName(String className) {
        this.stuName = className;
    }
}
